package com.akk.module.app.service;

import com.akk.module.app.entity.AppSharePic;
import com.akk.module.app.entity.AppSharePicExample;
import com.akk.module.app.mapper.AppSharePicMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AppSharePicService {

    @Autowired
    private AppSharePicExample sharePicExample;

    @Autowired
    private AppSharePicMapper sharePicMapper;

    public List<AppSharePic> sharePicByAppId(String appId){
        sharePicExample.clear();
        sharePicExample.createCriteria().andAppIdEqualTo(appId);
        return sharePicMapper.selectByExample(sharePicExample);
    }

    public void insert(AppSharePic sharePic){
        sharePicMapper.insert(sharePic);
    }

    public void update(AppSharePic sharePic){
        sharePicMapper.updateByPrimaryKey(sharePic);
    }

    public void delete(Integer sid){
        sharePicMapper.deleteByPrimaryKey(sid);
    }

    public AppSharePic findById(Integer sid){
        return sharePicMapper.selectByPrimaryKey(sid);
    }

}
